import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'Index',
        meta: {
            showTabBar: true
        },
        component: () => import('../views/index.vue'),
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/login.vue'),
    },
    {
        path: '/register',
        name: 'Register',
        component: () => import('../views/register.vue'),
    },
    {
        path: '/category/:categoryId',
        name: 'Category',
        component: () => import('../views/product/category.vue'),
    },
    {
        path: '/product/:productId',
        name: 'Product',
        component: () => import('../views/product/detail.vue'),
    },
    {
        path: '/product/comment',
        name: 'ProductComment',
        component: () => import('../views/product/comment.vue')
    },
    {
        path: '/search',
        name: 'Search',
        component: () => import('../views/product/search.vue'),
    },
    {
        path: '/order/preview',
        name: 'OrderPreview',
        component: () => import('../views/order/preview.vue'),
    },
    {
        path: '/order/payRes',
        name: 'OrderPayRes',
        component: () => import('../views/order/payRes.vue'),
    },
    {
        path: '/order/list',
        name: 'OrderList',
        component: () => import('../views/order/list.vue'),
    },
    {
        path: '/order/detail',
        name: 'OrderDetail',
        component: () => import('../views/order/detail.vue'),
    },
    {
        path: '/order/deliveryInfo',
        name: 'OrderDeliveryInfo',
        component: () => import('../views/order/delivery.vue'),
    },
    {
        path: '/order/refund',
        name: 'OrderRefund',
        component: () => import('../views/order/refund.vue'),
    },
    {
        path: '/address/list',
        name: 'ListAddress',
        component: () => import('../views/address/list.vue'),
    },
    {
        path: '/address/edit',
        name: 'EditAddress',
        component: () => import('../views/address/edit.vue'),
    },
    {
        path: '/cart',
        name: 'Cart',
        meta: {
            showTabBar: true
        },
        component: () => import('../views/member/cart.vue'),
    },
    {
        path: '/mine',
        name: 'Mine',
        meta: {
            showTabBar: true
        },
        component: () => import('../views/member/mine.vue'),
    },
    {
        path: '/comment/list',
        name: 'CommentList',
        component: () => import(`../views/comment/list.vue`),
    },
    {
        path: '/comment/edit',
        name: 'CommentEdit',
        component: () => import(`../views/comment/edit.vue`),
    },
    {
        path: '/comment/info',
        name: 'CommentInfo',
        component: () => import(`../views/comment/info.vue`),
    },
    {
        path: '/*',
        redirect: '/',
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})
export default router
